home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_14_inf_cinematic_exit.cog < prev    next >
Text File  |  1999-11-15  |  25KB  |  772 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 14_INF_Cinematic_Exit.cog
  4. #
  5. # Indy sends Sophia down the tubes and follows after
  6. #
  7. # [HB]+[SXC]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12. #
  13. # NOTE:  This cog uses global10 to flag state of inscription reading!
  14.  
  15. symbols
  16.  
  17. # .................................. MESSAGES ..................................
  18.  
  19.     message        startup
  20.     message     activate
  21.     message        pulse
  22.     message     timer
  23.     message     user0
  24.     message     user1
  25.     message     user2
  26.     message        user3
  27.     message        user7
  28.     
  29. # .................................. KEYFRAMES .................................
  30.     
  31.     keyframe    in_leverpull=0in_pullever.key            local
  32.  
  33.     keyframe    in_staggerA=0in_staggerA.key            local # 95x
  34.     keyframe    in_staggerB=0in_staggerB.key            local # 78x
  35.     keyframe    in_staggerhang=0in_staggerhang.key        local # 68x
  36.     keyframe    in_staggerfall=0in_staggerfall.key        local # 72x
  37.     
  38.     keyframe    lv_yankleverL=levers_pulleverL_3_3.key    local
  39.     
  40.     keyframe    mr_wingkey=0mr_plugin.key               local #2.87 sec
  41.     keyframe    mr_clampkeys=inf_robot_stand.key        local #2.87 sec
  42.     
  43.     keyframe    head_on_anim=inf_robo_head_anim.key         local
  44.  
  45. # .................................. SOUNDS ....................................
  46.  
  47. #    sound        in_sayline=Inxj092.wav                local # Didn't quite work-->sayline[0]
  48. #    sound        in_good=Inxj093.wav                    local # Good idea...not good enough.
  49. #    sound        in_anything=Inxj262.wav                local # That didn't do anything.
  50.     
  51.     # fit lines...
  52. #    sound        in_there=Inxj108.wav                local # There!-->in_sayline[3]
  53. #    sound        in_fits=Inxj109.wav                    local # It fits!
  54. #    sound        in_okay=Inxj271.wav                    local # Okay.
  55.  
  56.     # read plaque lines...
  57. #    sound        in_seewriting=Im05j01a.wav            local
  58. #    sound        in_inscription=Im05j06.wav            local
  59. #    sound        in_unseen_1=Im05j02.wav                local
  60. #    sound        in_unseen_2=Im05j08.wav                local
  61.                 
  62.     # scene lines...
  63.     sound        so_stopcrazy=Im11s03.wav            local
  64.     sound        md_marduksatisfied=Im11i04.wav        local
  65.     sound        in_whatdone=Im11j05.wav                local
  66.     sound        in_sophiaaa=Im11j06.wav                local
  67.     
  68.     # sound fx
  69.     sound        pow=imp2_activate.wav                        local    # Autoloaded
  70.     sound       horse_wingopen=inf_mr_wings_move.wav        local   # 4.104 sec
  71.     sound       clampsoundstart=nub_aethdoorarm_start_c.wav local   # 3.936 sec
  72.     sound       clampsoundstop=nub_aethdoorarm_stop_c.wav   local   # 1.921 sec
  73.     sound       rumbling=gen_falling_debris_c.wav           local   
  74.     sound       leverpull=gen_lever_pull.wav                local
  75.     sound       horse_headopen=inf_mr_headopen.wav          local   # 4.187 sec
  76.     
  77.     # not yet lines
  78.     sound       indylineb0=inxj058.wav                      local
  79.     sound       indylineb1=inxj059.wav                      local
  80.     sound       indylineb2=inxj060.wav                      local
  81.     sound       indylineb3=inxj061.wav                      local
  82.     sound       indylineb4=inxj090.wav                      local
  83.     sound       indylineb5=inxj095.wav                      local
  84.     
  85.     #music
  86.     sound       finalmusic=mus_inf_cutscene2.wav            local
  87.     
  88.     #fx
  89.     sound       zapdown=fol_gf_attack.wav                   local
  90.     sound       bigblast=gen_lightning_c.wav                local
  91.     sound       chargeup=nub_charged_pad_c.wav              local
  92.     sound       zapcycle=imp4_on_loop.wav                   local
  93.  
  94. # ............................... ACTOR THINGS .................................
  95.  
  96.     thing        player                                    local
  97.     thing        indy                                    linkid=0
  98.     thing       actorindy                 
  99.     thing        sophia
  100.     thing        cage
  101.     thing       marduk_robot
  102.  
  103. # .............................. OBJECT THINGS .................................
  104.  
  105.     thing        controlunit
  106.     thing       impstand                                                                
  107.     thing       fadeplane                               nolink
  108.     thing       robot_clamp
  109.  
  110.     thing       pieslice0                               nolink
  111.     thing       pieslice1                               nolink
  112.     thing       pieslice2                               nolink
  113.     thing       pieslice3                               nolink
  114.     thing       pieslice4                               nolink
  115.     thing       pieslice5                               nolink
  116.     thing       pieslice6                               nolink
  117.     thing       pieslice7                               nolink
  118.  
  119. # .............................. CAMERA THINGS .................................
  120.  
  121.     thing        cam_22                                    nolink
  122.     thing        cam_23                                    nolink
  123.     thing        cam_24                                    nolink
  124.     thing        cam_25                                    nolink
  125.     thing        cam_26                                    nolink
  126.     thing        cam_27                                    nolink
  127.     thing       swingpos_cam                            nolink
  128.     thing       mirrorball_cam                          nolink
  129.                         
  130.     thing       ct_6                                    nolink
  131.     thing        ct_22                                    nolink
  132.     thing        ct_23                                    nolink
  133.     thing        ct_24                                    nolink
  134.     thing        ct_25                                    nolink
  135.     thing        ct_26                                    nolink
  136.     thing        ct_27                                    nolink
  137.     thing        ct_28                                    nolink
  138.  
  139. # .............................. TARGET THINGS .................................
  140.  
  141.     thing        in_mk_14                                nolink
  142.     thing        in_mk_15                                nolink
  143.     thing        in_mk_16                                nolink
  144.  
  145.     thing        so_mk_4                                    nolink
  146.  
  147.     thing       imppartpos                              nolink
  148.     thing       mrdk_tgt0                               nolink
  149.     thing       mrdk_cam0                               nolink
  150.     thing       mrdk_cam1                               nolink
  151.     thing       mirrorballcam_tgt                       nolink
  152.  
  153. # ........................ OTHER ENGINE REFERENCES .............................
  154.  
  155.     cog            cagespincog
  156.     cog         hintcog
  157.     cog         mirrorballcog
  158.     
  159.     template    sparks=bluesparks                          local
  160.     
  161.     material    botmat=mrhdfr.mat                       local
  162.     
  163.     thing       zaptarget
  164.     
  165.     thing       zapsource
  166.     thing       zapsource1
  167.     thing       zapsource2
  168.     thing       zapsource3
  169.     
  170.     thing       lightning_strike                        local
  171.     thing       lightning_strike1                       local
  172.     thing       lightning_strike2                       local
  173.     thing       lightning_strike3                       local
  174.     
  175.     material    lightningmat0=inf_4sfx_lightning_a.mat    local
  176.     material    lightningmat1=inf_4sfx_lightning_b.mat    local
  177.     material    lightningmat2=inf_4sfx_lightning_c.mat    local
  178.     material    lightningmat3=inf_4sfx_lightning_d.mat    local
  179.  
  180. # ............................... VARIABLES ....................................
  181.     
  182.     vector        posOffset                                local
  183.     vector        angOffset                                local
  184.     
  185.     flex        in_headRate                                local
  186.     flex        in_rotRate                                local
  187.     flex        so_rotRate                                local
  188.  
  189.     flex        controlcollsize                            local
  190.  
  191.     int            alreadyworking=0                        local # prevent false starts
  192.     int            partisplaced=0                            local # overall state var
  193.     int            allpartsplaced=0                        local # endlevel semaphore        
  194.  
  195.     int            in_collType                                local
  196.     int            so_collType                                local
  197.     int            cg_collType                                local
  198.     
  199.     int            in_keyTrack1                            local
  200.  
  201.     int            cursound                                local
  202.     int            vibe                                    local
  203.     int            shake                                    local
  204.     int         currand                                 local
  205.     int         lastrand                                local
  206.     int         cx_colltype                             local
  207.     int         zapcogflag=0                            local
  208.     int         clampchanl=0                            local
  209.     int         headchannel                             local
  210.     int         lightningon=0                           local
  211.     int         cnt=0                                   local
  212.     int         headkey                                 local
  213.     int         voiceflag=0                             local
  214.     int         toggleint=0                             local
  215.     int         rumblsound                              local
  216.     int         zapcycleint                             local
  217.     
  218.     vector      playervec                               local
  219.     vector      playerxvec                              local
  220.     vector      playeryvec                              local
  221.     sector      finalcamsect                            local
  222.     
  223. end
  224.  
  225. # ==============================================================================
  226.  
  227. code
  228.  
  229. # ..............................................................................
  230.  
  231. startup:
  232.     
  233.     # Pointer to Player...
  234.     player = GetLocalPlayerThing();
  235.     
  236.     #ThingFadeAnim(fadeplane, 1, 0, 1, 0);
  237.     SetThingAlpha(fadeplane, 0);
  238.  
  239.     in_headRate = GetThingMaxHeadVel(indy);
  240.     in_rotRate = GetThingMaxRotVel(indy);
  241.     so_rotRate = GetThingMaxRotVel(sophia);
  242.     in_collType = GetCollideType(indy);
  243.     so_collType = GetCollideType(sophia);
  244.     cg_collType = GetCollideType(cage);
  245.     cx_collType = GetCollideType(controlunit);
  246.     controlcollsize = GetThingCollideSize(controlunit);
  247.  
  248.     return;
  249.  
  250. # ..............................................................................
  251.  
  252. user7:
  253.  
  254.     # IMP's #1, #3, #4 & Robohead ARE CORRECTLY PLACED
  255.     allpartsplaced = allpartsplaced + 1;
  256.  
  257. return;
  258.     
  259. # ..............................................................................
  260. #right part
  261. user0:
  262.     SendMessage(hintcog, user1);
  263.     # Do this scene once only...
  264.     partisplaced = 1;
  265.     
  266.     # Shut off Lightning trap above
  267.         SetCameraFocus(2, mirrorball_cam);
  268.         SetCameraSecondaryFocus(2, mirrorballcam_tgt);
  269.         SetCurrentCamera(2);
  270.         SetCameraFOV(100, 0, 0);
  271.         Sleep(0.5);
  272.         SendMessage(mirrorballcog, user0);
  273.         
  274.         //play power down noise
  275.         if (zapcogflag == 1)
  276.         {
  277.             zapcogflag = 1;
  278.             Sleep(1);
  279.         }
  280.         
  281.         if (zapcogflag == 0)
  282.         {
  283.             zapcogflag = 1;
  284.             PlaySoundLocal(zapdown, 1, 0, 0, 0);
  285.             CreateThing(sparks, mirrorballcam_tgt);
  286.             sleep(0.5);
  287.             CreateThing(sparks, mirrorballcam_tgt);
  288.             Sleep(1);
  289.         }
  290.     
  291.     #finish out scene started in INF_impswitcher
  292.     CopyOrientAndPos(actorindy, player);
  293.     SetThingFlags(actorindy, 0x80000);
  294.     ClearActorFlags(player, 0x200000);
  295.     ClearThingFlags(player, 0x80000);
  296.     SetCameraLookInterp(2, 0);
  297.     SetCameraPosInterp(2, 0);
  298.     SetCurrentCamera(1);
  299.     ResetCameraFOV(90, 0, 0);
  300.     RestoreExtCam();
  301.     EndCutScene();
  302.         
  303. return;
  304.  
  305. # ..............................................................................
  306. #right part
  307. activate:
  308.  
  309.     playervec=GetThingLVec(player);
  310.     playerxvec=VectorX(playervec);
  311.     playeryvec=VectorY(playervec);
  312.     printflex(playerxvec);
  313.     
  314. #impstand is activated-player is facing the right direction-right part is inserted-final scene is ready to play
  315.     if ((GetSenderRef() == impstand) &&
  316.         (playerxvec < 0.924) &&
  317.         (playerxvec > 0.382) &&
  318.         (allpartsplaced == 2) &&
  319.         (partisplaced == 1))
  320.     {
  321.         
  322.         StartCutscene(1);
  323.         
  324.         AISetCutsceneMode(actorindy);
  325.         CopyPlayerHolsters(player, actorindy);
  326.         StopThing(player);
  327.         
  328.         SetActorFlags(player, 0x200000);
  329.         ClearThingFlags(actorindy, 0x80000);
  330.         DeselectWeaponWait(player);
  331.         SetThingFlags(player, 0x80000);
  332.         
  333.         SetCameraFocus(2, swingpos_cam);
  334.         SetCameraSecondaryFocus(2, imppartpos);
  335.         SetCurrentCamera(2);
  336.         SetCameraFOV(90, 0, 0);
  337.         
  338.         #music
  339.         PlaySoundLocal(finalmusic, 1, 0, 0x0, 0);
  340.         
  341.         # Indy pulls lever...
  342.         PlayKey(controlunit, lv_yankleverL, 4, 0x12, 0);
  343.         PlaySoundThing(leverpull, controlunit, 1, 10, 20, 0x0080);
  344.         PlayKey(actorindy, in_leverpull, 4, 0x12, 1);
  345.         
  346.         #Revving up of machine
  347.         
  348.         # Prep...
  349.         SetCollideType(cage, 0);
  350.         SetCollideType(sophia, 0);
  351.         SetCollideType(controlunit, 0);
  352.         Sleep(1);
  353.         
  354.         # Cut to Shot of Marduk Robot opening wings and locking in clamps
  355.         SetCameraFocus(2, mrdk_cam0);
  356.         SetCameraSecondaryFocus(2, mrdk_tgt0);
  357.         SetCurrentCamera(2);
  358.         SetCameraFOV(110, 0, 0);
  359.         SetCameraFOV(80, 1, 4);
  360.  
  361. #Turning on Camera interps        
  362.         SetCameraLookInterp(2, 1);
  363.         SetCameraPosInterp(2, 1);
  364.         SetCameraInterpSpeed(2, 4);
  365.         Sleep(0.001);
  366.         
  367.         // Shut off collisions to clamp and robot
  368.         SetCollideType(robot_clamp, 0);
  369.         SetCollideType(marduk_robot, 0);
  370.         
  371.         // slide camera over
  372.         SetCameraFocus(2, mrdk_cam1);
  373.         
  374.         // Play Keys on clamp and robot
  375.         PlaySoundThing(horse_wingopen, marduk_robot, 1, 10, 20, 0x0080);                // 4.104 sec
  376.         PlayKey(marduk_robot, mr_wingkey, 2, 0x14, 0);
  377.         Sleep(1.234); 
  378.         PlayKey(robot_clamp, mr_clampkeys, 4, 0x14, 0);
  379.         clampchanl=PlaySoundThing(clampsoundstart, robot_clamp, 1, 10, 20, 0x0080);     // 3.936 sec                              // 2.87  sec
  380.         Sleep(2.87);
  381.         PlaySoundThing(clampsoundstop, robot_clamp, 1, 10, 20, 0x0080);                 // 1.921 sec
  382.         WaitForSound(clampchanl);
  383.         
  384.         // Lightning and Thunder
  385.         SetMaterialCel(botmat, 1);
  386.         headchannel=PlaySoundThing(horse_headopen, marduk_robot, 0.75, 10, 20, 0x0080);
  387.         //headkey=PlayKey(marduk_robot, head_on_anim, 1, 0x14, 0);
  388.         PlaySoundLocal(chargeup, 1, 0, 0, 0);
  389.         Sleep(2);
  390.         lightningon=1;
  391.         SetTimer(0.2);
  392.         zapcycleint = PlaySoundThing(zapcycle, marduk_robot, 1, 10, 20, 0x0081);
  393.         //ThingLightAnim(marduk_robot, '0.0 0.5 0.9', 0.65, '0.0 0.9 0.9', 0.65, 1);
  394.         SetCameraFOV(70, 1, 3);
  395.         Sleep(3);
  396.         
  397.         // Shut off Camera Interps
  398.         SetCameraLookInterp(2, 0);
  399.         SetCameraPosInterp(2, 0);
  400.         SetCameraInterpSpeed(2, 0);
  401.         Sleep(0.01);
  402.         
  403.         // Cut to shot of cage...
  404.         SetCameraLookInterp(2, 0);
  405.         SetCameraPosInterp(2, 0);
  406.         SetCameraFocus(2, cam_22);
  407.         SetCameraSecondaryFocus(2, ct_22);
  408.         SetCurrentCamera(2);
  409.         SetCameraFOV(80, 0, 0.0);
  410.         DetachThing(ct_6);
  411.         AttachThingtoThing(ct_22, cage);
  412.         Sleep(0.01);
  413.         
  414.         // Track cage descending...
  415.         SendMessage(cagespincog, user3); # drop cage & Sophia into Oblivion!
  416.         Sleep(1);
  417.         
  418.         PlaySoundThing(pow, pieslice0, 1, 10, 20, 0);
  419.         ThingFadeAnim(pieslice0, 1.0, 0.0, 2.0, 0);
  420.         ThingFadeAnim(pieslice1, 1.0, 0.0, 2.0, 0);
  421.         ThingFadeAnim(pieslice2, 1.0, 0.0, 2.0, 0);
  422.         ThingFadeAnim(pieslice3, 1.0, 0.0, 2.0, 0);
  423.         ThingFadeAnim(pieslice4, 1.0, 0.0, 2.0, 0);
  424.         ThingFadeAnim(pieslice5, 1.0, 0.0, 2.0, 0);
  425.         ThingFadeAnim(pieslice6, 1.0, 0.0, 2.0, 0);
  426.         ThingFadeAnim(pieslice7, 1.0, 0.0, 2.0, 0);
  427.         
  428.         Sleep(1.0);
  429.         DetachThing(ct_22);
  430.         
  431.         // Sophia: "Jones!  Stop!  Are you crazy???"
  432.         PlayVoice(sophia, so_stopcrazy, 1.0, 0);
  433.         
  434.         // Prep Indy...
  435.         TeleportThing(actorindy, so_mk_4);
  436.         AISetLookThing(actorindy, cage);
  437.         
  438.         // Continue tracking cage...
  439.         #SetCameraFOV(80, 1, 3.0);
  440.         AISetLookThing(actorindy, in_mk_15);
  441.         Sleep(3.0);
  442.         
  443.         // Brief shake...
  444.         shake = 1; # light
  445.         SetPulse(0.1); # shake on
  446.         rumblsound = PlaySoundLocal(rumbling, 0.7, 0, 1, 0);
  447.         Sleep(1.0);
  448.         shake = 2; # medium
  449.         Sleep(1.0);
  450.         shake = 1; # light
  451.         
  452.         // TO DO: visual & sound effects...
  453.         
  454.         // Camera moves in...
  455.         SetCameraInterpSpeed(2, 2.0);
  456.         SetCameraLookInterp(2, 1);
  457.         SetCameraPosInterp(2, 1);
  458.         Sleep(0.01);
  459.         SetCameraFocus(2, cam_23);
  460.         SetCameraSecondaryFocus(2, ct_23);
  461.         SetCameraFOV(60, 1, 2.0);
  462.         
  463.         // actorindy runs out onto platform's edge...
  464.         AISetMoveSpeed(actorindy, 2.5);
  465.         AISetMoveThing(actorindy, in_mk_14, 0);
  466.         Sleep(1.0);
  467.         
  468.         // Shake off...
  469.         SetPulse(0.0); # shake off
  470.         AIWaitForStop(actorindy);
  471.         AISetLookThing(actorindy, in_mk_16);
  472.         CopyOrientAndPos(actorindy, player); 
  473.                 
  474.         // actorindy: "Sophia, what have I done?!"
  475.         PlayVoice(actorindy, in_whatdone, 1.0, 0);
  476.         Sleep(0.5);
  477.         
  478.         // Start Camera shake...
  479.         shake = 3; # heavy
  480.         SetPulse(0.1);
  481.         SetCameraInterpSpeed(2, 1.5);
  482.         Sleep(0.5);
  483.         
  484.         // actorindy staggers...
  485.         PlayKey(actorindy, in_staggerA, 4, 0x12, 1);
  486.         
  487.         // actorindy slips off platform...
  488.         SetCameraSecondaryFocus(2, ct_24);
  489.         ClearThingFlags(actorindy, 0x4000); # shadow off    
  490.         PlayKey(actorindy, in_staggerB, 4, 0x12, 1);
  491.         in_keyTrack1 = PlayKey(actorindy, in_staggerhang, 4, 0x14, 0);
  492.         
  493.         // Cut to up-shot of actorindy...
  494.         SetCameraLookInterp(2, 0);
  495.         SetCameraPosInterp(2, 0);
  496.         SetCameraFocus(2, cam_24);
  497.         SetCameraSecondaryFocus(2, ct_25);
  498.         SetCameraFOV(70, 0, 0.0);
  499.         shake = 1; # light
  500.         
  501.         // Camera moves in...
  502.         SetCameraInterpSpeed(2, 2.0);
  503.         SetCameraLookInterp(2, 1);
  504.         SetCameraPosInterp(2, 1);
  505.         Sleep(0.01);
  506.         SetCameraFocus(2, cam_25);
  507.         SetCameraSecondaryFocus(2, ct_26);
  508.         SetCameraFOV(40, 1, 2.0);
  509.         Sleep(2.0);
  510.         
  511.         // Cut to down angle...
  512.         SetCameraLookInterp(2, 0);
  513.         SetCameraPosInterp(2, 0);
  514.         SetCameraFocus(2, cam_26);
  515.         SetCameraSecondaryFocus(2, ct_27);
  516.         SetCameraFOV(70, 0, 0.0);
  517.         TeleportThing(actorindy, in_mk_15); # mid-air
  518.         shake = 2; # medium
  519.         Sleep(0.01);
  520.         SetCameraFOV(30, 1, 3.0);
  521.         
  522.         // actorindy falls into Aetherium...
  523.         in_keyTrack1 = PlayKey(actorindy, in_staggerfall, 4, 0x10, 0);
  524.         
  525.         // actorindy: "Sophiaaaa..."
  526.         PlayVoice(actorindy, in_sophiaaa, 1.0, 0);
  527.         Sleep(3.0);
  528.         ResetThing(actorindy);
  529.         DestroyThing(actorindy); # see you on the other side
  530.         
  531.         // Cut to Marduk statue...
  532.         SetCameraFocus(2, cam_27);
  533.         SetCameraSecondaryFocus(2, ct_28);
  534.         SetCameraFOV(80, 0, 0.0);
  535.         Sleep(0.01);
  536.         SetCameraFOV(60, 1, 5.0); # a suggestion only
  537.         shake = 1; # light
  538.         Sleep(1.0);
  539.         
  540.         // TO DO: maybe change how this sound is played once Marduk statue is in place...
  541.         # lightningon = 0;
  542.         SetTimer(0.1);
  543.         cursound = PlayVoice(marduk_robot, md_marduksatisfied, 1, 0);
  544.         voiceflag=1;
  545.         WaitForSound(cursound);
  546.         voiceflag=0;
  547.         SetMaterialCel(botmat, 1);
  548.         SetPulse(0.0);
  549.         Sleep(2.0);
  550.         
  551.         // TO DO:  fade out and end level!
  552.         AttachThingToThing(fadeplane, cam_27);
  553.         ThingFadeAnim(fadeplane, 0, 1, 2, 0);
  554.         Sleep(3);
  555.         SetCameraLookInterp(2, 0);
  556.         SetCameraPosInterp(2, 0);
  557.         EndCutScene();
  558.         alreadyworking = 0;
  559.         allpartsplaced = 3;
  560.         partisplaced = 2;
  561.         lightningon = 0;
  562.         StopSound(rumblsound, 0);
  563.         StopSound(zapcycleint, 0);
  564.         finalcamsect=GetThingSector(cam_27);
  565.         SectorSound(finalcamsect, zapcycle, 0);
  566.         JonesEndLevel();
  567.         return;
  568.     }
  569.     
  570.     // impstand is activated-player is facing the right direction-right part is inserted-final scene has not played yet
  571.     if ((GetSenderRef() == impstand) &&
  572.         (playerxvec < 0.924) &&
  573.         (playerxvec > 0.382) &&
  574.         (playeryvec <= 0) &&
  575.         (allpartsplaced != 2) &&
  576.         (partisplaced == 1))
  577.     {
  578.         StartCutscene(1);
  579.         
  580.         AISetCutsceneMode(actorindy);
  581.         CopyPlayerHolsters(player, actorindy);
  582.         StopThing(player);
  583.         
  584.         SetActorFlags(player, 0x200000);
  585.         ClearThingFlags(actorindy, 0x80000);
  586.         DeselectWeaponWait(player);
  587.         SetThingFlags(player, 0x80000);
  588.         
  589.         SetCameraFocus(2, swingpos_cam);
  590.         SetCameraSecondaryFocus(2, imppartpos);
  591.         SetCurrentCamera(2);
  592.         SetCameraFOV(90, 0, 0);
  593.         
  594.         # Indy pulls lever...
  595.         PlayKey(controlunit, lv_yankleverL, 4, 0x12, 0);
  596.         PlaySoundThing(leverpull, controlunit, 1, 10, 20, 0x0080);
  597.         PlayKey(actorindy, in_leverpull, 4, 0x12, 1);
  598.         
  599.         # Shut off Lightning trap above
  600.         SetCameraFocus(2, mirrorball_cam);
  601.         SetCameraSecondaryFocus(2, mirrorballcam_tgt);
  602.         SetCurrentCamera(2);
  603.         SetCameraFOV(100, 0, 0);
  604.         Sleep(0.5);
  605.         SendMessage(mirrorballcog, user0);
  606.         
  607.         //play power down noise
  608.         if (zapcogflag == 1)
  609.         {
  610.             zapcogflag = 1;
  611.             Sleep(1);
  612.         }
  613.         
  614.         if (zapcogflag == 0)
  615.         {
  616.             zapcogflag = 1;
  617.             PlaySoundLocal(zapdown, 1, 0, 0, 0);
  618.             CreateThing(sparks, mirrorballcam_tgt);
  619.             sleep(0.5);
  620.             CreateThing(sparks, mirrorballcam_tgt);
  621.             Sleep(1);
  622.         }
  623.         
  624.         ClearThingFlags(player, 0x80000);          
  625.         CopyOrientAndPos(actorindy, player); 
  626.         SetThingFlags(actorindy, 0x80000);
  627.         SetCurrentCamera(1);            
  628.         ResetCameraFOV(0, 0.0);
  629.         RestoreExtCam();               
  630.         EndCutScene();
  631.         ClearActorFlags(player, 0x200000);
  632.         return;
  633.     }
  634.     
  635. return;
  636.  
  637. # ..............................................................................
  638. //wrong part
  639. user1:
  640.  
  641.     print("the wrong part has been placed");
  642.  
  643. return;
  644.  
  645. # ..............................................................................
  646. //no part
  647. user2:
  648.  
  649.     print("there is no current part");
  650.  
  651. return;
  652.  
  653. # ..............................................................................
  654.  
  655. pulse:
  656.  
  657.     vibe = RandBetween(1, 4);
  658.     if (vibe == 1)
  659.     {
  660.         if (shake == 1)
  661.         {
  662.             posOffset = '-0.005 0.00 -0.002'; #1
  663.             angOffset = '0.00 -0.002 0.002';
  664.         }
  665.         if (shake == 2)
  666.         {
  667.             posOffset = '0.01 -0.01 0.005'; #2
  668.             angOffset = '0.005 0.00 -0.005';
  669.         }
  670.         if (shake == 3)
  671.         {
  672.             posOffset = '0.01 0.02 -0.02'; #3
  673.             angOffset = '-0.01 0.01 -0.01';
  674.         }
  675.     }
  676.     else if (vibe == 2)
  677.     {
  678.         if (shake == 1)
  679.         {
  680.             posOffset = '0.005 -0.005 0.002'; #2
  681.             angOffset = '0.002 0.00 -0.002';
  682.         }
  683.         if (shake == 2)
  684.         {
  685.             posOffset = '0.005 0.01 -0.01'; #3
  686.             angOffset = '-0.005 0.005 -0.00';
  687.         }
  688.         if (shake == 3)
  689.         {
  690.             posOffset = '-0.01 0.00 0.02'; #4
  691.             angOffset = '0.00 0.00 0.01';
  692.         }
  693.     }
  694.     else if (vibe == 3)
  695.     {
  696.         if (shake == 1)
  697.         {
  698.             posOffset = '0.002 0.005 -0.005'; #3
  699.             angOffset = '-0.002 0.005 -0.005';
  700.         }
  701.         if (shake == 2)
  702.         {
  703.             posOffset = '-0.01 0.00 0.01'; #4
  704.             angOffset = '0.00 0.00 0.01';
  705.         }
  706.         if (shake == 3)
  707.         {
  708.             posOffset = '-0.02 0.00 -0.01'; #1
  709.             angOffset = '0.00 -0.01 0.01';
  710.         }
  711.     }
  712.     else if (vibe == 4)
  713.     {
  714.         if (shake == 1)
  715.         {
  716.             posOffset = '-0.002 0.00 0.005'; #4
  717.             angOffset = '0.00 0.00 0.002';
  718.         }
  719.         if (shake == 2)
  720.         {
  721.             posOffset = '-0.01 0.00 -0.005'; #1
  722.             angOffset = '0.00 -0.005 0.005';
  723.         }
  724.         if (shake == 3)
  725.         {
  726.             posOffset = '0.02 -0.02 0.01'; #2
  727.             angOffset = '0.01 0.00 -0.01';
  728.         }
  729.     }
  730.  
  731.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  732.  
  733. return;
  734.     
  735. # ..............................................................................
  736. timer:
  737.  
  738.     if (lightningon == 1)
  739.     {
  740.         lightning_strike=CreatePolylineThing(zapsource, zaptarget, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  741.         lightning_strike1=CreatePolylineThing(zapsource1, zaptarget, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  742.         lightning_strike2=CreatePolylineThing(zapsource2, zaptarget, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  743.         lightning_strike3=CreatePolylineThing(zapsource3, zaptarget, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  744.         SetTimer(RandBetween(1, 2)*0.1);
  745.     }
  746.     
  747.     toggleint=1-toggleint;
  748.     if (voiceflag == 0)
  749.     {
  750.         return;
  751.     }
  752.     
  753.     if ((toggleint == 0) && (voiceflag == 1))
  754.     {
  755.         SetMaterialCel(botmat, 1);
  756.         SetTimer(RandBetween(1, 2)*0.05);
  757.         return;
  758.     }
  759.     
  760.     if ((toggleint == 1) && (voiceflag == 1))
  761.     {
  762.         SetMaterialCel(botmat, 0);
  763.         SetTimer(RandBetween(1, 2)*0.05);
  764.         return;
  765.     }
  766.     
  767. return;
  768.  
  769. # ..............................................................................
  770.  
  771. end
  772.